#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QDebug>
#include <QException>
#include "bass.h"
#include "bass_fx.h"
#include "playthread.h"
#include "waveform.h"
#include "magic.h"
#include "exporter.h"
#include "fx_basic.h"
#include "editor_widget.h"
#include <QGridLayout>
#include <QCheckBox>
#include <QScrollBar>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QSizePolicy>
#include <QGroupBox>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    QMessageBox msgBox;

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);
    void dragMoveEvent( QDragMoveEvent* event );
    void dragLeaveEvent( QDragLeaveEvent* event );

public slots:
    void play();
    void pause();
    void stop();
    void valueChanged(int arg);
    void actTrig(int arg);
    void moveSlider(double arg1, double arg2);
    void addTrack();
    void addTrack(QString str);
    void del(AudioThread*);
    void exportTrack();
    void form_fx(QAction* act);
    void openForm();
    void fx(DWORD type, const void *params);
    void volume(int);
    void leftRight(int);
    void deleteTrackSlot();
    void delEffects();
    void checkOnOff(bool);
    void getDevices(QStringList);
    void deviceChanged(int);
    void magicRecord();
    void addAttribute(int);
    bool eventFilter(QObject *obj, QEvent *event);
    void channels();

signals:
    void sendChannels(QVector<HSTREAM>);
private:
    void setTime(double arg1, double arg2);
    void calcMaxTime();
    Ui::MainWindow *ui;
    //AudioThread* pt;
    Magic *magic;
    Exporter *exporter;
    QVector<AudioThread*> list;
    QVector<QCheckBox*> check_box;
    QVector<WaveForm*> waves;
    QVector<QSlider*> list_volume;
    QVector<QSlider*> list_leftRight;
    QVector<QPushButton*> list_button;
    QVector<QPushButton*> list_delEffects;
    QGridLayout *gLayoutChoiceRegion;
    QWidget *widgetChoiceRegion;
    QScrollArea *scrollArea;
    QVBoxLayout *vBoxLayout;
    QGroupBox *groupBoxChoiceRegion;
    double maxTime;
    bool isPlaying;
    bool isRecord;
};

#endif // MAINWINDOW_H
